

package com.scs.application.modules.base.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.model.DataEntity;
import com.scs.application.core.utils.excel.annotation.ExcelAutoColumnSize;
import com.scs.application.core.utils.excel.annotation.ExcelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 商品实体对象
 */
@ExcelAutoColumnSize
@TableName("hospital_material")
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@Accessors(chain = true)
public class ExcelHospitalMaterialDTO extends DataEntity implements IExcelDataModel, IExcelModel, Serializable {

    private String materialId;

    private String supplierId;

    private String hospitalId;

    @ExcelComment(notNull = true, example = "医院测试")
    @Excel(name = "医院名称")
    @NotBlank(message = "医院名称不能为空")
    private String hospitalName;

    @ExcelComment(notNull = true, example = "供应商测试")
    @Excel(name = "供应商名称")
    @NotBlank(message = "供应商名称不能为空")
    private String supplierName;

    /**
     * 生产厂商Id
     */
    private String manufacturerId;

    @ExcelComment(notNull = true, value = "如果厂商为空就填：默认厂商", example = "厂商测试")
    @Excel(name = "厂商名称", width = 29)
    @NotBlank(message = "厂商名称不能为空")
    private String manufacturerName;

    /**
     * 商品名称
     */
    @ExcelComment(notNull = true, example = "商品测试")
    @Excel(name = "品名", width = 65)
    @NotBlank(message = "品名不能为空")
    @Length(min = 1, max = 100, message = "品名长度必须介于 1 和 100 之间")
    private String materialName;

    /**
     * 商品编码
     */
    @ExcelComment(notNull = false, value = "如果spd存在mscm耗材编码就填，如果不存在就为空；选填", example = "mat001")
    @Excel(name = "商品编码", width = 50)
    //@NotBlank(message = "商品编码不能为空")
    @Length(max = 20, message = "商品编码长度必须介于 0 和 20 之间")
    private String materialCode;

    /**
     * hrp编码
     */
    @ExcelComment(notNull = false, value = "选填", example = "hrp001")
    @Excel(name = "hrp编码", width = 50)
    @Length(max = 30, message = "hrp编码长度必须介于 0 和 30 之间")
    private String materialHrpCode;

    /**
     * 商品规格ID
     */
    private String materialSpecId;

    /**
     * 规格
     */
    @ExcelComment(notNull = true, value = "如果规格不存在就填：默认品规", example = "规格测试")
    @Excel(name = "规格", orderNum = "10", isImportField = "true")
    @NotBlank(message = "规格不能为空")
    @Length(min = 1, max = 100, message = "规格长度必须介于 1 和 100 之间")
    private String materialSpec;


    private String id;

    private Integer rowNum;
    private String errorMsg;

    @Override
    public Integer getRowNum() {
        return rowNum;
    }

    @Override
    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }

    @Override
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
